package org.twndmv.blimpl;

import java.util.List;

import org.twndmv.bl.VehicleMgmt;
import org.twndmv.bo.Person;
import org.twndmv.bo.VehicleRegistration;
import org.twndmv.dao.VehicleRegistrationDAO;
import org.twndmv.jpa.VehicleRegistrationDAOImpl;

public class VehicleMgmtImpl implements VehicleMgmt {
	
	private VehicleRegistrationDAO vehicleDAO;
	
	public VehicleMgmtImpl() {
		vehicleDAO = new VehicleRegistrationDAOImpl();
	}

	public VehicleMgmtImpl(VehicleRegistrationDAO vehicleDAO2) {
        this.vehicleDAO = vehicleDAO2;
	}

	public void addRegistration(VehicleRegistration newVehicle) {
		vehicleDAO.createRegistration(newVehicle);
	}

	public List<VehicleRegistration> getRegistrationsByMakeModel(String make, String model) {
		return vehicleDAO.getRegistrationsByMakeModel(make, model);
	}


	public List<VehicleRegistration> getRegistrationsByOwner(Person personId) {
		return vehicleDAO.getRegistrationsByOwner(personId);
	}
	
	public List<VehicleRegistration> getAllVehicles() {
		return vehicleDAO.getAllVehicles();
	}
	
	public VehicleRegistration getRegistrationById(long id) {
		return vehicleDAO.getRegistrationByID(id);
	}


}
